<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<h2 id="tracks">${util:mallName(baseProduct.mallType)} 가격 왓칭 생성 : ${baseProduct.name}</h2>
<div id="header_tracker">
	<div id="watch_forms">
 		<table>
   			<thead>
       			<tr>
		            <th class="text_left">쇼핑몰</th>
		            <th>알림</th>
		            <th>희망가격</th>
		            <th>현재가격</th>
		            <th>차이</th>
		            <th>상태</th>
		            <th>Label</th>
		            <th class="email_column_header">이메일</th>
		            <th><span class="light_grey">SNS</span></th>
         				<th colspan="2">확인</th>
       			</tr>
   			</thead>
   			<tbody>
   				<c:forEach var="inflowProducts" items="${baseProduct.inflowProducts }" >
	   				<c:forEach var="memberTracking" items="${memberTrackings }" >
	   					<c:set var="noticePrice" value="0"/>
	   					<c:set var="distinction" value="${inflowProducts.presentPrice}"/>		
	   					<c:if test="${inflowProducts.inflowProductSeq == memberTracking.inflowProductSeq }">
	   						<c:set var="noticePrice" value="${memberTracking.noticePrice}"/>
	   						<c:set var="distinction" value="${inflowProducts.presentPrice - memberTracking.noticePrice}"/>		
	   					</c:if>
					</c:forEach>   				
            	<tr>
					<td class="text_left price_type_column">
	                	<div class="pricetype pricetype0 on square"><!-- // --></div> 
	                	<div class="pricetype_label">
		                	<a href="${inflowProducts.link}" target="_blank"> ${util:siteName(inflowProducts.siteType)}</a>
		                </div>
	              	</td>
	                <td><img  src="http://d1i0o2gnhzh6dj.cloudfront.net/images/tick.png"></td>
	              	<td style="white-space: nowrap;"><input  class="price " type="text" numberonly="true"  name="price"  value="${noticePrice}" id="noticePrice_${inflowProducts.inflowProductSeq}">원</td>
           			<td style="white-space:nowrap;"><span class="black"><fmt:formatNumber  value="${inflowProducts.presentPrice}" pattern="#,###" />원</span></td>
             		<td><span class="green"><fmt:formatNumber  value="${distinction}" pattern="#,###"/>원</span></td>
           			<td><span  class="sss">${baseProduct.stateType }</span></td>
             		<td style="white-space: nowrap;"><input class="label " type="text" name="new_label" value=""></td>
             		<td><input type="checkbox" name="email_notify" ></td>
           			<td><input type="checkbox" name="twitter_notify" ></td>
           			<td style="white-space: nowrap;">
           				<button class="blue" type="submit" id="update_Price_${inflowProducts.inflowProductSeq}">수정 </button>
           				<button  class="red" type="submit" id="delete_Price_${inflowProducts.inflowProductSeq}">삭제</button>
           			</td>
         		</tr>
         		</c:forEach>
		</tbody>
		</table>
	</div>
</div>